<%--
  Created by IntelliJ IDEA.
  User: LiangJun Kang
  Date: 2023-07-13
  Time: 10:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/public.css" media="all">
    <script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>
    <style>
        .layui-table-cell {
            text-align: center;
            height: 45px;
            white-space: normal;
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <table class="layui-hide" id="LoginLogTableId" lay-filter="TableId"></table>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;

        table.render({
            elem: '#LoginLogTableId',
            request: {
                pageName: 'pageNum', // 页码的参数名称，默认：page
                limitName: 'pageSize' // 每页数据条数的参数名，默认：limit
            },
            url: '${pageContext.request.contextPath}/manager/loginLog/list',//查询用户信息
            toolbar: '#toolbarDemo',
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {type: "checkbox"},
                {title: '序号', type: "numbers", align: "center"},
                {field: 'id', title: '用户帐号', sort: true},
                {field: 'ip', title: 'ip地址'},
                {field: 'location', title: '登入地址'},
                {field: 'createtime', title: '登入时间', sort: true, templet:
                        function(d){
                        var timeStr = d.createtime.toString();
                        var timeArr = timeStr.split(",");
                        var year = timeArr[0];
                        var month = timeArr[1];
                        var day = timeArr[2];
                        var hour = timeArr[3];
                        var minute = timeArr[4];
                        var second = timeArr[5];
                        return year + '年' + month + '月' + day + '日 ' + hour + ':' + minute + ':' + second;
                    }
                }
            ]],
            limits: [8, 15, 20, 25, 50, 100],
            limit: 8,
            page: true,
            loading: true,
            skin: 'grid',
        });
    });
</script>
</body>
</html>
